package cn.xiaoyu.su.exception;

import cn.xiaoyu.su.enums.BizCodeEnum;
import lombok.Data;

/**
 * @author sufs
 * @date 2022/10/27 11:30
 */
@Data
public class BizException extends RuntimeException{

    private int code;

    private String message;

    public BizException() {
        super();
    }

    public BizException(BizCodeEnum bizCodeEnum) {
        super(bizCodeEnum.getMessage());
        this.code = bizCodeEnum.getCode();
        this.message = bizCodeEnum.getMessage();
    }

}
